package com.itheima.patterns.behaviorpattern.Iterator.jdk;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class TestArratList {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        //添加元素
        list.add("1001");
        list.add("1002");
        list.add("1003");
        //删除元素
        list.remove("1003");
        Iterator<String> iterator = list.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}